.text
.section .rodata
.LC0:
    .string "Originally x = %d and y = %d.\n"

.LC1:
    .string "Now x = %d and y = %d.\n"

.text
.globl main
.type main, @function
main:
    pushq %rbp
    movq %rsp, %rbp

    subq $16, %rsp
    // x
    movl $5, -4(%rbp)
    // y
    movl $10, -8(%rbp)
    movl -4(%rbp), %esi
    movl -8(%rbp), %edx
    movq $.LC0, %rdi
    call printf

    leaq -4(%rbp), %rdi
    leaq -8(%rbp), %rsi
    call interchange

    movl -4(%rbp), %esi
    movl -8(%rbp), %edx
    movq $.LC1, %rdi
    call printf

    movl $0, %eax
    movq %rbp, %rsp
    popq %rbp
    ret

.text
.globl interchange
.type interchange, @function
interchange:
    pushq %rbp
    movq %rsp, %rbp
    movl (%rdi), %eax
    movl (%rsi), %edx
    movl %edx, (%rdi)
    movl %eax, (%rsi)
    popq %rbp
    ret